package com.local.common.constants;

/**
 * 异常code
 */
public enum ExceptionCodeEnum {
    BUSINESS_EXCEPTION(201, "系统异常，请稍后再试"),
    PARAM_EXCEPTION(202, "参数错误"),
    GOODS_NOT_EXIST(203, "商品不存在"),
    GOODS_PUT_DOWN(204, "商品不存在"),
    GOODS_COUNT_CART_ITEM_LIMIT(205, "单个商品在购物车中的数量已经超过最大限度，请先支付再继续加入购物车"),
    GOODS_COUNT_CART_LIMIT(206, "购物车中商品数量超过最大限度，请先支付再继续加入购物车"),

    ORDER_SAVE_ADDRESS_EMPTY(207, "请填写收货地址"),
    ORDER_SAVE_CART_EMPTY(208, "购物车无商品，请先添加商品至购物车"),
    ORDER_AUTH_NO_USER_OWN(209, "您无权查看其他用户的订单"),
    ORDER_SAVE_GOODS_PUT_DOWN(210, "已下架，无法生成订单"),
    ORDER_GOODS_NOT_EXIST_CART(211, "购物车商品异常，请检查购物车商品"),
    ORDER_GOODS_STOCK_NUM_NOT_ENOUGH(212, "库存不足，请返回购物车修改"),
    ORDER_CLEAR_CART_FAILED(213, "购物车清除失败，请稍后再试"),
    ORDER_TOTAL_PRICE_ERROR(214, "订单价格异常，请重新检查"),
    ORDER_CREATE_FAILED(215, "订单生成失败，请稍后再试"),
    ORDER_ITEMS_CREATE_FAILED(216, "订单明细生成失败，请稍后再试"),
    ORDER_NOT_EXIST(217, "订单不存在"),
    ORDER_STATUS_NOT_PRE_PAY(218, "只有待支付的订单才能进行支付"),

    SYSTEM_EXCEPTION(401, "系统异常，请稍后再试");

    private Integer code;
    private String message;

    ExceptionCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
